﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;

public class DrawLetterMono : MonoBehaviour {



    public DrawEatAnimMono.EEatAnimalEnum animalType;

    //public GameObject target;

    //public GameObject[] m_test;

    //public Transform m_Brush;

    //public Transform[] m_LetteArray;

    //public Transform m_DrawMask;
    //public Transform m_DrawMaskParent;

    //public float moveDuration = 1;

    //public float minDis = 1.0f;

    //// 画的时候，左右最大便宜量
    //public float maxProjectDis = 2;

    //// 多长距离创建一个面片
    //public float drawMaskDis = 0.5f;

    //DrawRealize3D dlContro;

    //void Start()
    //{
    //    dlContro = new DrawRealize3D(m_Brush, m_LetteArray, m_DrawMask.gameObject, m_DrawMaskParent.gameObject);
    //    dlContro.OnStart(()=>{
    //        print("on draw complete!");
    //    });
    //}

    //private void Update()
    //{
    //    if (dlContro != null)
    //        dlContro.OnUpdate();
    //}

    public void Test()
    {
        //for (int j = 0; j < m_test.Length; j++)
        //{
        //    GameObject test = m_test[j];
        //    test.AddComponentEx<DrawLetterMono>();
        //    DrawEatAnimMono[] monoArray = test.GetComponentsInChildren<DrawEatAnimMono>();
        //    List<GameObject> list = new List<GameObject>();
        //    foreach (DrawEatAnimMono mono in monoArray)
        //    {
        //        for (int i = 0; i < mono.transform.childCount; i++)
        //        {
        //            list.Add(mono.transform.GetChild(i).gameObject);
        //        }
        //        foreach (GameObject go in list)
        //        {
        //            DestroyImmediate(go);
        //        }
        //        list.Clear();
        //        //GameObject tex = new GameObject("ModelTexture");
        //        GameObject tex = GameObject.Instantiate(target);
        //        tex.name = "ModelTexture";
        //        RectTransform rect = tex.AddComponentEx<RectTransform>();
        //        rect.transform.SetParent(mono.transform);
        //        rect.anchoredPosition3D = Vector3.zero;
        //        rect.transform.localScale = Vector3.one;
        //        rect.transform.localRotation = Quaternion.identity;
        //    }
        //}
    }

}
